home *** CD-ROM | disk | FTP | other *** search
Text File | 1993-09-16 | 17.6 KB | 330 lines | [TEXT/CCL2] |
-
- (in-package :traps) ;
- ; Created: Sunday, January 6, 1991 at 10:44 PM
- ; GestaltEqu.p
- ; Pascal Interface to the Macintosh Libraries
- ;
- ; Copyright Apple Computer, Inc. 1988-1990
- ; All rights reserved
- ;
-
- ;;;;;;;;;;;;;
- ;
- ; Modification History
- ;
- ; 04/28/93 mwp Release
- ; 09/24/92 bill %get-word -> %get-signed-word
- ; ------------- 2.0
- ; 08/23/91 bill #_ReplaceGestalt no longer ignores it's last parameter
- ; Fix arg evaluation order problem.
- ;
-
- ; $IFC UNDEFINED UsingIncludes
- ; $SETC UsingIncludes := 0
- ; $ENDC
-
- ; $IFC NOT UsingIncludes
-
- ; $ENDC
-
- ; $IFC UNDEFINED UsingGestaltEqu
- ; $SETC UsingGestaltEqu := 1
-
- ; $I+
- ; $SETC GestaltEquIncludes := UsingIncludes
- ; $SETC UsingIncludes := 1
- ; $IFC UNDEFINED UsingTypes
-
- (require-interface 'TYPES) ; $I $$Shell(PInterfaces)Types.p
- ; $ENDC
- ; $SETC UsingIncludes := GestaltEquIncludes
-
- ; ***********************
- ; * Gestalt error codes
- ; ***********************
- (defconstant $gestaltUnknownErr -5550); value returned if Gestalt doesn't know the answer
- (defconstant $gestaltUndefSelectorErr -5551); undefined selector was passed to Gestalt
- (defconstant $gestaltDupSelectorErr -5552); tried to add an entry that already existed
- (defconstant $gestaltLocationErr -5553); gestalt function ptr wasn't in sysheap
-
- ; *************************
- ; * Environment Selectors
- ; *************************
- (defconstant $gestaltVersion :|vers|); gestalt version
- (defconstant $gestaltAddressingModeAttr :|addr|); addressing mode attributes
- (defconstant $gestalt32BitAddressing 0); using 32-bit addressing mode
- (defconstant $gestalt32BitSysZone 1); 32-bit compatible system zone
- (defconstant $gestalt32BitCapable 2); Machine is 32-bit capable
- (defconstant $gestaltAliasMgrAttr :|alis|); Alias Mgr Attributes
- (defconstant $gestaltAliasMgrPresent 0); True if the Alias Mgr is present
- (defconstant $gestaltAppleTalkVersion :|atlk|); appletalk version
- (defconstant $gestaltAUXVersion :|a/ux|); a/ux version, if present
- (defconstant $gestaltConnMgrAttr :|conn|); connection mgr attributes
- (defconstant $gestaltConnMgrPresent 0)
- (defconstant $gestaltConnMgrCMSearchFix 1); Fix to CMAddSearch?
- (defconstant $gestaltCRMAttr :|crm |); comm resource mgr attributes
- (defconstant $gestaltCRMPresent 0)
- (defconstant $gestaltCTBVersion :|ctbv|); CommToolbox version
- (defconstant $gestaltDBAccessMgrAttr :|dbac|); Database Access Mgr attributes
- (defconstant $gestaltDBAccessMgrPresent 0); True if Database Access Mgr present
- (defconstant $gestaltDITLExtAttr :|ditl|); AppenDITL, etc. calls from CTB
- (defconstant $gestaltDITLExtPresent 0); True if calls are present
- (defconstant $gestaltEasyAccessAttr :|easy|); Easy Access attributes
- (defconstant $gestaltEasyAccessOff 0); if Easy Access present, but off (no icon)
- (defconstant $gestaltEasyAccessOn 1); if Easy Access "On"
- (defconstant $gestaltEasyAccessSticky 2); if Easy Access "Sticky"
- (defconstant $gestaltEasyAccessLocked 3); if Easy Access "Locked"
- (defconstant $gestaltEditionMgrAttr :|edtn|); Edition Mgr attributes
- (defconstant $gestaltEditionMgrPresent 0); True if Edition Mgr present
- (defconstant $gestaltAppleEventsAttr :|evnt|); Apple Events attributes
- (defconstant $gestaltAppleEventsPresent 0); True if Apple Events present
- (defconstant $gestaltFindFolderAttr :|fold|); Folder Mgr attributes
- (defconstant $gestaltFindFolderPresent 0); True if Folder Mgr present
- (defconstant $gestaltFontMgrAttr :|font|); Font Mgr attributes
- (defconstant $gestaltOutlineFonts 0); True if Outline Fonts supported
- (defconstant $gestaltFPUType :|fpu |); fpu type
- (defconstant $gestaltNoFPU 0) ; no FPU
- (defconstant $gestalt68881 1) ; 68881 FPU
- (defconstant $gestalt68882 2) ; 68882 FPU
- (defconstant $gestalt68040FPU 3); 68040 built-in FPU
- (defconstant $gestaltFSAttr :|fs |); file system attributes
- (defconstant $gestaltFullExtFSDispatching 0); has really cool new HFSDispatch dispatcher
- (defconstant $gestaltHasFSSpecCalls 1); has FSSpec calls
- (defconstant $gestaltHasFileSystemManager 2); has a file system manager
- (defconstant $gestaltFXfrMgrAttr :|fxfr|); file transfer manager attributes
- (defconstant $gestaltFXfrMgrPresent 0)
- (defconstant $gestaltHardwareAttr :|hdwr|); hardware attributes
- (defconstant $gestaltHasVIA1 0) ; VIA1 exists
- (defconstant $gestaltHasVIA2 1) ; VIA2 exists
- (defconstant $gestaltHasASC 3) ; Apple Sound Chip exists
- (defconstant $gestaltHasSCC 4) ; SCC exists
- (defconstant $gestaltHasSCSI 7) ; SCSI exists
- (defconstant $gestaltHasSoftPowerOff 19); Capable of software power off
- (defconstant $gestaltHelpMgrAttr :|help|); Help Mgr Attributes
- (defconstant $gestaltHelpMgrPresent 0); true if help mgr is present
- (defconstant $gestaltKeyboardType :|kbd |); keyboard type
- (defconstant $gestaltMacKbd 1)
- (defconstant $gestaltMacAndPad 2)
- (defconstant $gestaltMacPlusKbd 3)
- (defconstant $gestaltExtADBKbd 4)
- (defconstant $gestaltStdADBKbd 5)
- (defconstant $gestaltPrtblADBKbd 6)
- (defconstant $gestaltPrtblISOKbd 7)
- (defconstant $gestaltStdISOADBKbd 8)
- (defconstant $gestaltExtISOADBKbd 9)
- (defconstant $gestaltADBKbdII 10)
- (defconstant $gestaltADBISOKbdII 11)
- (defconstant $gestaltLowMemorySize :|lmem|); size of low memory area
- (defconstant $gestaltLogicalRAMSize :|lram|); logical ram size
- (defconstant $gestaltMiscAttr :|misc|); miscellaneous attributes
- (defconstant $gestaltScrollingThrottle 0); true if scrolling throttle on
- (defconstant $gestaltSquareMenuBar 2); true if menu bar is square
- (defconstant $gestaltMMUType :|mmu |); mmu type
- (defconstant $gestaltNoMMU 0) ; no MMU
- (defconstant $gestaltAMU 1) ; address management unit
- (defconstant $gestalt68851 2) ; 68851 PMMU
- (defconstant $gestalt68030MMU 3); 68030 built-in MMU
- (defconstant $gestalt68040MMU 4); 68040 built-in MMU
- (defconstant $gestaltStdNBPAttr :|nlup|); standard nbp attributes
- (defconstant $gestaltStdNBPPresent 0)
- (defconstant $gestaltNotificationMgrAttr :|nmgr|); notification manager attributes
- (defconstant $gestaltNotificationPresent 0); notification manager exists
- (defconstant $gestaltNuBusConnectors :|sltc|); bitmap of NuBus connectors
- (defconstant $gestaltOSAttr :|os |); o/s attributes
- (defconstant $gestaltSysZoneGrowable 0); system heap is growable
- (defconstant $gestaltLaunchCanReturn 1); can return from launch
- (defconstant $gestaltLaunchFullFileSpec 2); can launch from full file spec
- (defconstant $gestaltLaunchControl 3); launch control support available
- (defconstant $gestaltTempMemSupport 4); temp memory support
- (defconstant $gestaltRealTempMemory 5); temp memory handles are real
- (defconstant $gestaltTempMemTracked 6); temporary memory handles are tracked
- (defconstant $gestaltIPCSupport 7); IPC support is present
- (defconstant $gestaltSysDebuggerSupport 8); system debugger support is present
- (defconstant $gestaltOSTable :|ostt|); OS trap table base
- (defconstant $gestaltToolboxTable :|tbtt|); OS trap table base
- (defconstant $gestaltExtToolboxTable :|xttt|); Extended Toolbox trap table base
- (defconstant $gestaltLogicalPageSize :|pgsz|); logical page size
- (defconstant $gestaltPowerMgrAttr :|powr|); power manager attributes
- (defconstant $gestaltPMgrExists 0)
- (defconstant $gestaltPMgrCPUIdle 1)
- (defconstant $gestaltPMgrSCC 2)
- (defconstant $gestaltPMgrSound 3)
- (defconstant $gestaltPPCToolboxAttr :|ppc |); PPC toolbox attributes
-
- ;
- ; * PPC will return the combination of following bit fields.
- ; * e.g. gestaltPPCSupportsRealTime +gestaltPPCSupportsIncoming + gestaltPPCSupportsOutGoing
- ; * indicates PPC is cuurently is only supports real time delivery
- ; * and both incoming and outgoing network sessions are allowed.
- ; * By default local real time delivery is supported as long as PPCInit has been called.
-
- (defconstant $gestaltPPCToolboxPresent #x0); PPC Toolbox is present Requires PPCInit to be called
- (defconstant $gestaltPPCSupportsRealTime #x1000); PPC Supports real-time delivery
- (defconstant $gestaltPPCSupportsIncoming #x1); PPC will deny incoming network requests
- (defconstant $gestaltPPCSupportsOutGoing #x2); PPC will deny outgoing network requests
- (defconstant $gestaltProcessorType :|proc|); processor type
- (defconstant $gestalt68000 1)
- (defconstant $gestalt68010 2)
- (defconstant $gestalt68020 3)
- (defconstant $gestalt68030 4)
- (defconstant $gestalt68040 5)
- (defconstant $gestaltParityAttr :|prty|); parity attributes
- (defconstant $gestaltHasParityCapability 0); has ability to check parity
- (defconstant $gestaltParityEnabled 1); parity checking enabled
- (defconstant $gestaltQuickdrawVersion :|qd |); quickdraw version
- (defconstant $gestaltOriginalQD #x0); original 1-bit QD
- (defconstant $gestalt8BitQD #x100); 8-bit color QD
- (defconstant $gestalt32BitQD #x200); 32-bit color QD
- (defconstant $gestalt32BitQD11 #x210); 32-bit color QDv1.1
- (defconstant $gestalt32BitQD12 #x220); 32-bit color QDv1.2
- (defconstant $gestalt32BitQD13 #x230); 32-bit color QDv1.3
- (defconstant $gestaltQuickdrawFeatures :|qdrw|); quickdraw features
- (defconstant $gestaltHasColor 0); color quickdraw present
- (defconstant $gestaltHasDeepGWorlds 1); GWorlds can be deeper than 1-bit
- (defconstant $gestaltHasDirectPixMaps 2); PixMaps can be direct (16 or 32 bit)
- (defconstant $gestaltHasGrayishTextOr 3); supports text mode grayishTextOr
- (defconstant $gestaltPhysicalRAMSize :|ram |); physical RAM size
- (defconstant $gestaltPopupAttr :|pop!|); popup cdef attributes
- (defconstant $gestaltPopupPresent 0)
- (defconstant $gestaltResourceMgrAttr :|rsrc|); Resource Mgr attributes
- (defconstant $gestaltPartialRsrcs 0); True if partial resources exist
- (defconstant $gestaltScriptMgrVersion :|scri|); Script Manager version number <08/05/89 pke>
- (defconstant $gestaltScriptCount :|scr#|); number of active script systems <08/05/89 pke>
- (defconstant $gestaltSerialAttr :|ser |); Serial attributes
- (defconstant $gestaltHasGPIaToDCDa 0); GPIa connected to DCDa
- (defconstant $gestaltHasGPIaToRTxCa 1); GPIa connected to RTxCa clock input
- (defconstant $gestaltHasGPIbToDCDb 2); GPIb connected to DCDb
- (defconstant $gestaltSoundAttr :|snd |); sound attributes
- (defconstant $gestaltStereoCapability 0); sound hardware has stereo capability
- (defconstant $gestaltStereoMixing 1); stereo mixing on external speaker
- (defconstant $gestaltSoundIOMgrPresent 3); The Sound I/O Manager is present
- (defconstant $gestaltBuiltInSoundInput 4); built-in Sound Input hardware is present
- (defconstant $gestaltHasSoundInputDevice 5); Sound Input device available
- (defconstant $gestaltStandardFileAttr :|stdf|); Standard File attributes
- (defconstant $gestaltStandardFile58 0); True if selectors 5-8 (StandardPutFile-CustomGetFile) are supported
- (defconstant $gestaltTextEditVersion :|te |); TextEdit version number <08/05/89 pke>
- (defconstant $gestaltTE1 1) ; TextEdit in MacIIci ROM <8Aug89smb>
- (defconstant $gestaltTE2 2) ; TextEdit with 6.0.4 Script Systems on MacIIci (Script bug fixes for MacIIci) <8Aug89smb>
- (defconstant $gestaltTE3 3) ; TextEdit with 6.0.4 Script Systems all but MacIIci <8Aug89smb>
- (defconstant $gestaltTE4 4) ; TextEdit in System 7.0
- (defconstant $gestaltTE5 5) ; TextWidthHook available in TextEdit
- (defconstant $gestaltTermMgrAttr :|term|); terminal mgr attributes
- (defconstant $gestaltTermMgrPresent 0)
- (defconstant $gestaltTimeMgrVersion :|tmgr|); time mgr version
- (defconstant $gestaltStandardTimeMgr 1); standard time mgr is present
- (defconstant $gestaltRevisedTimeMgr 2); revised time mgr is present
- (defconstant $gestaltExtendedTimeMgr 3); extended time mgr is present
- (defconstant $gestaltVMAttr :|vm |); virtual memory attributes
- (defconstant $gestaltVMPresent 0); true if virtual memory is present
-
- ; ************************
- ; * Info-only selectors
- ; ***********************
- (defconstant $gestaltMachineType :|mach|); machine type
- (defconstant $kMachineNameStrID -16395)
- (defconstant $gestaltClassic 1)
- (defconstant $gestaltMacXL 2)
- (defconstant $gestaltMac512KE 3)
- (defconstant $gestaltMacPlus 4)
- (defconstant $gestaltMacSE 5)
- (defconstant $gestaltMacII 6)
- (defconstant $gestaltMacIIx 7)
- (defconstant $gestaltMacIIcx 8)
- (defconstant $gestaltMacSE030 9)
- (defconstant $gestaltPortable 10)
- (defconstant $gestaltMacIIci 11)
- (defconstant $gestaltMacIIfx 13)
- (defconstant $gestaltMacClassic 17)
- (defconstant $gestaltMacIIsi 18)
- (defconstant $gestaltMacLC 19)
- (defconstant $gestaltMachineIcon :|micn|); machine icon
- (defconstant $gestaltROMSize :|rom |); rom size
- (defconstant $gestaltROMVersion :|romv|); rom version
- (defconstant $gestaltSystemVersion :|sysv|); system version
-
-
- (deftrap _gestalt ((selector :ostype) (response (:pointer :signed-long)))
- (:no-trap :signed-integer)
- (:no-trap (ccl::%stack-block ((ret 8))
- (ccl::%gen-trap #xA1AD :return-block ret :d0 selector :a0 response '(:d0 :a0))
- (%put-ptr response (%get-ptr ret 4))
- (%get-signed-word ret 2))))
-
- (deftrap _newgestalt ((selector :ostype) (gestaltfunction :pointer))
- (:d0 :signed-integer)
- (:register-trap #xA3AD :d0 selector :a0 gestaltfunction))
-
- (deftrap _replacegestalt ((selector :ostype) (gestaltfunction :pointer) (oldgestaltfunction (:pointer :pointer)))
- (:no-trap :signed-integer)
- (:no-trap (ccl:%stack-block ((ret 8))
- (ccl::%gen-trap 42413 :return-block ret :d0 selector :a0 gestaltfunction '(:d0 :a0))
- (%put-ptr oldgestaltfunction (%get-ptr ret 4))
- (%get-signed-word ret 2))))
-
- ; $ENDC
-
-
- (export '($gestaltsystemversion $gestaltromversion $gestaltromsize
- $gestaltmachineicon $gestaltmaclc $gestaltmaciisi $gestaltmacclassic
- $gestaltmaciifx $gestaltmaciici $gestaltportable $gestaltmacse030
- $gestaltmaciicx $gestaltmaciix $gestaltmacii $gestaltmacse
- $gestaltmacplus $gestaltmac512ke $gestaltmacxl $gestaltclassic
- $kmachinenamestrid $gestaltmachinetype $gestaltvmpresent
- $gestaltvmattr $gestaltextendedtimemgr $gestaltrevisedtimemgr
- $gestaltstandardtimemgr $gestalttimemgrversion $gestalttermmgrpresent
- $gestalttermmgrattr $gestaltte5 $gestaltte4 $gestaltte3 $gestaltte2
- $gestaltte1 $gestalttexteditversion $gestaltstandardfile58
- $gestaltstandardfileattr $gestalthassoundinputdevice
- $gestaltbuiltinsoundinput $gestaltsoundiomgrpresent
- $gestaltstereomixing $gestaltstereocapability $gestaltsoundattr
- $gestalthasgpibtodcdb $gestalthasgpiatortxca $gestalthasgpiatodcda
- $gestaltserialattr $gestaltscriptcount $gestaltscriptmgrversion
- $gestaltpartialrsrcs $gestaltresourcemgrattr $gestaltpopuppresent
- $gestaltpopupattr $gestaltphysicalramsize $gestalthasgrayishtextor
- $gestalthasdirectpixmaps $gestalthasdeepgworlds $gestalthascolor
- $gestaltquickdrawfeatures $gestalt32bitqd13 $gestalt32bitqd12
- $gestalt32bitqd11 $gestalt32bitqd $gestalt8bitqd $gestaltoriginalqd
- $gestaltquickdrawversion $gestaltparityenabled
- $gestalthasparitycapability $gestaltparityattr $gestalt68040
- $gestalt68030 $gestalt68020 $gestalt68010 $gestalt68000
- $gestaltprocessortype $gestaltppcsupportsoutgoing
- $gestaltppcsupportsincoming $gestaltppcsupportsrealtime
- $gestaltppctoolboxpresent $gestaltppctoolboxattr $gestaltpmgrsound
- $gestaltpmgrscc $gestaltpmgrcpuidle $gestaltpmgrexists
- $gestaltpowermgrattr $gestaltlogicalpagesize $gestaltexttoolboxtable
- $gestalttoolboxtable $gestaltostable $gestaltsysdebuggersupport
- $gestaltipcsupport $gestalttempmemtracked $gestaltrealtempmemory
- $gestalttempmemsupport $gestaltlaunchcontrol
- $gestaltlaunchfullfilespec $gestaltlaunchcanreturn
- $gestaltsyszonegrowable $gestaltosattr $gestaltnubusconnectors
- $gestaltnotificationpresent $gestaltnotificationmgrattr
- $gestaltstdnbppresent $gestaltstdnbpattr $gestalt68040mmu
- $gestalt68030mmu $gestalt68851 $gestaltamu $gestaltnommu
- $gestaltmmutype $gestaltsquaremenubar $gestaltscrollingthrottle
- $gestaltmiscattr $gestaltlogicalramsize $gestaltlowmemorysize
- $gestaltadbisokbdii $gestaltadbkbdii $gestaltextisoadbkbd
- $gestaltstdisoadbkbd $gestaltprtblisokbd $gestaltprtbladbkbd
- $gestaltstdadbkbd $gestaltextadbkbd $gestaltmacpluskbd
- $gestaltmacandpad $gestaltmackbd $gestaltkeyboardtype
- $gestalthelpmgrpresent $gestalthelpmgrattr $gestalthassoftpoweroff
- $gestalthasscsi $gestalthasscc $gestalthasasc $gestalthasvia2
- $gestalthasvia1 $gestalthardwareattr $gestaltfxfrmgrpresent
- $gestaltfxfrmgrattr $gestalthasfilesystemmanager
- $gestalthasfsspeccalls $gestaltfullextfsdispatching $gestaltfsattr
- $gestalt68040fpu $gestalt68882 $gestalt68881 $gestaltnofpu
- $gestaltfputype $gestaltoutlinefonts $gestaltfontmgrattr
- $gestaltfindfolderpresent $gestaltfindfolderattr
- $gestaltappleeventspresent $gestaltappleeventsattr
- $gestalteditionmgrpresent $gestalteditionmgrattr
- $gestalteasyaccesslocked $gestalteasyaccesssticky
- $gestalteasyaccesson $gestalteasyaccessoff $gestalteasyaccessattr
- $gestaltditlextpresent $gestaltditlextattr $gestaltdbaccessmgrpresent
- $gestaltdbaccessmgrattr $gestaltctbversion $gestaltcrmpresent
- $gestaltcrmattr $gestaltconnmgrcmsearchfix $gestaltconnmgrpresent
- $gestaltconnmgrattr $gestaltauxversion $gestaltappletalkversion
- $gestaltaliasmgrpresent $gestaltaliasmgrattr $gestalt32bitcapable
- $gestalt32bitsyszone $gestalt32bitaddressing
- $gestaltaddressingmodeattr $gestaltversion $gestaltlocationerr
- $gestaltdupselectorerr $gestaltundefselectorerr $gestaltunknownerr))
- (provide-interface 'GESTALTEQU)
-